package client;

import java.awt.GridLayout;

import javax.swing.JPanel;

/**
 * Table to play a game. Contains another sitting players and pot.
 * 
 * @author papq
 */
public class TablePanel extends JPanel {
	PlayerPanel[] panelPlayer = new PlayerPanel[6];
	PotPanel potPanel;
	PotPanel potPanel2;

	public TablePanel() {
		super();

		setLayout(new GridLayout(2, 3, 10, 10));

		for (int i = 0; i < 5; i++) {
			panelPlayer[i] = new PlayerPanel();
			add(panelPlayer[i]);
		}

		// panelPlayer[i].setNameLabelText("Player 1");
		// panelPlayer[i].setAttributeLabelText("big blind");
		// panelPlayer[i].setBetValueLabelText("Bet: 10T");
		// panelPlayer[i].setBankrollLabelText("Bankroll: 50T");
		// panelPlayer[i].setAuctionLabelText("Check");

		potPanel = new PotPanel();
		potPanel.setMaxBetLabelText("Max bet: 0T");
//		potPanel.setPotLabelText("POT: 0T");
		add(potPanel);
		
		potPanel2 = new PotPanel();
		potPanel2.setMaxBetLabelText("");
//		potPanel2.setPotLabelText("POT: 0T");
		add(potPanel2);

		panelPlayer[5] = new PlayerPanel();
		add(panelPlayer[5]);
	}

	public int getOtherPlayerBankroll(int iDOfOtherPlayer) {
		int otherPlayerBankroll = Integer.parseInt(panelPlayer[iDOfOtherPlayer].getBankrollLabelText());
		return otherPlayerBankroll;
	}

}
